package com.cdshangpai.utils.api;

import java.util.concurrent.LinkedBlockingQueue;

public class HttpQueueCallback implements HttpCallback{
    public LinkedBlockingQueue<String> responseQueue;

    public HttpQueueCallback(LinkedBlockingQueue<String> responseQueue)
    {
        this.responseQueue=responseQueue;
    }

    @Override
    public void callback(HttpResponse httpResponse) {
        try
        {
            responseQueue.put(httpResponse.getSuccess()?httpResponse.data.toString():"");
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
